import java.util.Arrays;

public class Test1 {
    public static void main(String[] args) {
        //append方法
        StringBuilder sb = new StringBuilder();
        sb.append("Hello");
        sb.append(" ");
        sb.append("World");
        System.out.println(sb.toString());
        System.out.println("=================");

        //insert方法
        StringBuilder sb1 = new StringBuilder("HelloWorld");
        sb1.insert(5 , ",");
        System.out.println(sb1.toString());
        System.out.println("===================");

        //delete和deleteCharAt方法
        StringBuilder sb2 = new StringBuilder("HelloWorld");
        //delete方法,删除从从一个字符到另一个子字符中间所有的字符
        sb2.delete(3 , 5);
        System.out.println(sb2.toString());
        //deleteCharAt，删除某个指定的字符
        sb2.deleteCharAt(2);
        System.out.println(sb2.toString());
        System.out.println("=====================");

        //replace方法
        StringBuilder sb3 = new StringBuilder("HelloWorld");
        sb3.replace(5 , 10 , "java");
        System.out.println(sb3.toString());
        System.out.println("=====================");

        //序列反转
        StringBuilder sb4 = new StringBuilder("HelloWorld");
        sb4.reverse();
        System.out.println(sb4.toString());

        //
        String name = "HelloWorld";
        System.out.println(name.indexOf("e"));


    }


}
